<template>
  <el-container>
    <el-header style="padding: 0;">
    <Topbar></Topbar>
    </el-header>

    <div class="withAside" v-if="asideVisible">
      <el-card style="margin: 20px;">
        <el-container style="height: 80vh;">
        <el-aside style="width: 240px;">
          <Monitoringbar></Monitoringbar>
        </el-aside>
        <el-main style="padding: 0;">
          <router-view></router-view>
        </el-main>
      </el-container>
      </el-card>
      
    </div>

    <div class="withoutAside" v-else>
      <el-main style="padding: 0;">
        <router-view></router-view>
      </el-main>
    </div>
  </el-container>

</template>

<script>
import Topbar from "@/components/Topbar.vue";
import Monitoringbar from "@/components/Monitoringbar.vue";
import { mapState } from 'vuex';

export default {
  name: "role1_homepage",
  components: { Topbar, Monitoringbar },
  computed: {
    ...mapState(['asideVisible'])
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
